Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
electron-reload typescript compiled to a wrong object ( to be electronReload['default'])

I am trying to learn typescript with electron a bit, using a template "electron-quick-start-typescript" (https://github.com/electron/electron-quick-start-typescript). I want to add a hot reload function to the template so I could hot reload while editing the code. I am trying to add

import electronReload from "electron-reload";
electronReload(__dirname, {});

these two lines of code, but after the compilation it became

var electron_reload_1 = require("electron-reload");
(0, electron_reload_1["default"])(__dirname, {});

where electron_reload_1["default"] cannot be recognised. I can run the compiled js while I manually changed electron_reload_1["default"] to electron_reload_1.

I guess the problem is because in electron-reload lib, it is not using export default module to export a function. Does anyone has experience on making typescript + electron hot reloadable? Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I just found that adding "esModuleInterop": true in tsconfig.json would solve this problem.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda